Ext.define('TS.view.dilema.MovieForm', {
    extend: 'TS.lib.Form',
    alias : 'widget.dilemapointmovieform',
    //title : 'Ocena',
	url:URL.dilema.form.dilemapointmovie,
	items:[
		{xtype:'hidden',name:'dilema_point_movie_id'},
		
		{xtype:'area',name:'dilema_point_movie_comment'},
		{xtype:'combo',empty:'Autor',b:1,name:'author_id',store:Dict.author,childFld:'movie_id',onSelect:Util.fldLoad},
		{xtype:'combo',r:1,empty:'Film',name:'movie_id',store:Ext.clone(Dict.movie)},
		
		Factory.btn.ico('add',function(){
			var fix = 'movie';
			Factory.winForm(fix,null,'simple');
			
			Util.fldVal(fix+'->#dilema_point_id','dilema_point->id');
		}),
		
		{xtype:'hidden',name:'dilema_point_id'}
	],
	buttons:[{
		text:'Zapisz',
		handler:Util.f.save,
		callback:function(){
			//Dict.bible.load();
			Util.store('DilemaPointMovie').load();
		}
	},{
		text:'Nowe',
		handler:Util.f.clear,
		callback:function(){
			Util.s.load('DilemaPointMovie');
			Util.fldVal('dilemapointmovie->#dilema_point_id','dilema_point->id');
		}
	},{
		text:'Usuń',
		handler:Util.f.del,
		handlerConfig:{
			url:URL.dilema.del.dilemapointmovie
		}
	}]
});